﻿using System;
using System.Configuration;
using System.Data;
using System.Windows;
using System.Xml;

using BalanceManagerApp.ViewModel;

namespace BalanceManagerApp
{
	/// <summary>
	/// Interaction logic for App.xaml
	/// </summary>
	public partial class App : Application
	{
		protected override void OnStartup(StartupEventArgs e)
		{
			base.OnStartup(e);
			
			MainWindow window = new MainWindow();
			
			var viewModel = new MainWindowViewModel();
			
			EventHandler handler = null;
            handler = delegate
            {
                viewModel.RequestClose -= handler;
                window.Close();
            };
            viewModel.RequestClose += handler;
            
            window.DataContext = viewModel;

            window.Show();
		}
	}
}